package com.dimples.dd.system.controller;

import com.dimples.dd.common.constant.DDServerConstant;
import com.dimples.dd.common.pojo.PageResult;
import com.dimples.dd.log.core.annotation.ApiLog;
import com.dimples.dd.log.core.enums.OperateTypeEnum;
import com.dimples.dd.system.model.query.SmsLogPageQuery;
import com.dimples.dd.system.model.vo.SmsLogPageVO;
import com.dimples.dd.system.service.SystemSmsLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.simpleframework.xml.core.Validate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/10/28
 */
@Validate
@Tag(name = "短信管理-短信日志")
@RestController
@RequestMapping("sms-log")
@RequiredArgsConstructor
public class SysSmsLogController {

    private final SystemSmsLogService systemSmsLogService;

    @GetMapping("/page")
    @Operation(summary = "获得短信日志分页")
    @PreAuthorize("@ss.hasPerm('system:sms-log:query')")
    @ApiLog(operateType = OperateTypeEnum.SELECT, applicationName = DDServerConstant.DD_SERVER_SYSTEM)
    public PageResult<SmsLogPageVO> selectSmsLogPage(@Valid SmsLogPageQuery pageQuery) {
        return this.systemSmsLogService.selectSmsLogPage(pageQuery);
    }

}
